package myactionplugin;

import com.nomagic.actions.AMConfigurator;
import com.nomagic.actions.ActionsCategory;
import com.nomagic.actions.ActionsManager;
import com.nomagic.actions.NMAction;
import com.nomagic.magicdraw.actions.MDActionsCategory;

public class MainMenuConfigurator implements AMConfigurator {

	
	String EXAMPLES="Reverse";
	
	private NMAction action;
	
	
	public  MainMenuConfigurator(NMAction action) {
		this.action=action;
	}

	public int getPriority() {
		return AMConfigurator.MEDIUM_PRIORITY;
	}

	public void configure(ActionsManager mngr) {
		ActionsCategory category = (ActionsCategory) mngr.getActionFor(EXAMPLES);

		if( category == null )
		{
			// creating new category
			category = new MDActionsCategory(EXAMPLES,EXAMPLES);
			category.setNested(true);
			mngr.addCategory(category);
		}
		category.addAction(action);
		
	}


}
